var express = require('express');
var router = express.Router();
var http = require('http');


//http://m.toutiao.com/list/?tag=news_society&ac=wap&count=20&format=json_raw&as=A1B5C878A57C4C6&cp=58854CB45C36DE1&min_behot_time=0

// get请求抓取数据
router.get('/', function(req, res, next) { 
   http.get('http://m.toutiao.com/list/?tag=news_society&ac=wap&count=20&format=json_raw&as=A1B5C878A57C4C6&cp=58854CB45C36DE1&min_behot_time=0', (httpRes) => {
       
        var obj = '';
        httpRes.setEncoding('utf8');
        httpRes.on("data",(data)=>{
            obj += data;
        })

        httpRes.on("end",(data)=>{
            res.send(obj);
        })
    }).on('error', (e) => {
        res.send("isError")
    });
});



module.exports = router;
